home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form waveplot
- Caption = "Waveform Plot R & D Project"
- ClientHeight = 4500
- ClientLeft = 1995
- ClientTop = 1950
- ClientWidth = 4815
- ClipControls = 0 'False
- Height = 5190
- Icon = WAVEPLT.FRX:0000
- Left = 1935
- LinkTopic = "Form1"
- ScaleHeight = 4500
- ScaleWidth = 4815
- Top = 1320
- Width = 4935
- Begin Frame Frame1
- BackColor = &H00C0C0C0&
- Caption = "Use Play w Timeclock on menubar also"
- Height = 1215
- Left = 600
- TabIndex = 4
- Top = 3000
- Width = 3495
- Begin CommandButton cmdstoploop
- Caption = "Stop Loop"
- Height = 435
- Left = 2160
- TabIndex = 8
- Top = 720
- Width = 1215
- End
- Begin CommandButton cmdsoundloop
- Caption = "&Loop"
- Height = 435
- Left = 2160
- TabIndex = 7
- Top = 240
- Width = 1215
- End
- Begin CommandButton Command1
- Caption = "Full Screen Plot"
- Enabled = 0 'False
- Height = 435
- Left = 120
- TabIndex = 6
- Top = 240
- Width = 1935
- End
- Begin CommandButton cmd_playwave
- Caption = "Play wo timeclock"
- Enabled = 0 'False
- Height = 435
- Left = 120
- TabIndex = 5
- Top = 720
- Width = 1935
- End
- End
- Begin PictureBox picwavetime
- AutoRedraw = -1 'True
- BackColor = &H00000000&
- FillColor = &H00C0C000&
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 13.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H0000FFFF&
- Height = 420
- Left = 1800
- ScaleHeight = 390
- ScaleWidth = 1185
- TabIndex = 3
- Top = 2475
- Width = 1215
- End
- Begin PictureBox pic_stats
- AutoRedraw = -1 'True
- BackColor = &H00000000&
- FillColor = &H0000FFFF&
- ForeColor = &H0000FFFF&
- Height = 900
- Left = 120
- ScaleHeight = 870
- ScaleWidth = 4545
- TabIndex = 2
- Top = 1560
- Width = 4575
- End
- Begin CommonDialog FileOpenDialog
- DialogTitle = "Open Wave File"
- Filename = "*.wav"
- Filter = "Wave Audio|*.wav"
- Left = 4200
- Top = 2640
- End
- Begin PictureBox Picture1
- ClipControls = 0 'False
- ForeColor = &H0000FF00&
- Height = 1215
- Left = 120
- ScaleHeight = 1185
- ScaleWidth = 4545
- TabIndex = 0
- Top = 240
- Width = 4575
- Begin Shape Shape1
- BackStyle = 1 'Opaque
- BorderStyle = 0 'Transparent
- FillColor = &H000000FF&
- FillStyle = 0 'Solid
- Height = 100
- Left = 10
- Top = 1100
- Width = 50
- End
- End
- Begin Label Label3
- Caption = "Stretch form wider,click replot for more detailed view."
- Height = 255
- Left = 0
- TabIndex = 1
- Top = 0
- Width = 4695
- End
- Begin Menu FileMenu
- Caption = "File"
- Begin Menu OpenOption
- Caption = "Open Wave File"
- End
- Begin Menu QuitOption
- Caption = "Quit"
- End
- End
- Begin Menu EffectsMenu
- Caption = "Replot"
- Begin Menu EchoOption
- Caption = "Replot"
- End
- End
- Begin Menu PlayOption
- Caption = "Play w Timeclock"
- End
- Option Explicit
- Dim startup As Integer
- Dim dCURX As Single
- Sub cmd_playwave_Click ()
- Dim success As Integer
- 'this is an alternative to playing a wave file,rather than
- 'using the WaveOut procedure.No time update though
- success = mciexecute("play " & wavepath)
- End Sub
- Sub cmdsoundloop_Click ()
- 'loop a wave file
- Dim success As Integer, params As Integer
- params = SND_ASYNC Or SND_LOOP
- success = sndPlaySound(wavepath, params)
- End Sub
- Sub cmdstoploop_Click ()
- Dim success As Integer, params As Integer
- 'stops the looped wave file
- 'will stop playing loop when current wave is done,will not cause an
- 'immediate stop
- params = params And Not SND_LOOP
- success = sndPlaySound(wavepath, params)
- End Sub
- Sub Command1_Click ()
- 'plot the wave using the full screen size
- Dim dummy As Integer
- frm_big.Show
- screen.MousePointer = 11
- PlayOption.Enabled = False
- dummy = PlotaWave(hWaveSampleData, frm_big, 2)
- PlayOption.Enabled = True
- screen.MousePointer = 0
- PlayOption_Click
- End Sub
- Sub EchoOption_Click ()
- Dim dummy As Integer
- screen.MousePointer = 11
- PlayOption.Enabled = False
- dummy = PlotaWave(hWaveSampleData, Me, 1)
- PlayOption.Enabled = True
- screen.MousePointer = 0
- End Sub
- Sub Form_Load ()
- Dim cx As Single, curY As Single
- Me.Left = (screen.Width - Me.Width) / 2
- Me.Top = (screen.Height - Me.Height) / 2
- startup = True
- picwavetime.Print "00:00.00"
- PlayOption.Enabled = False
- EchoOption.Enabled = False
- EffectsMenu.Enabled = False
- Picture1.ScaleHeight = 700
- Picture1.DrawWidth = 2
- Picture1.CurrentX = 0
- Picture1.CurrentY = 2000
- Picture1.BackColor = QBColor(0)
- 'Red center line(base line)
- Picture1.Line (cx, 2000)-(Picture1.ScaleWidth, 2000), QBColor(4)
- End Sub
- Sub Form_Resize ()
- If startup Then
- startup = False
- Exit Sub
- End If
- Picture1.Left = 0
- Picture1.Width = Me.ScaleWidth
- label3.Width = Me.ScaleWidth
- frame1.Left = (ScaleWidth - frame1.Width) / 2
- pic_stats.Left = (ScaleWidth - pic_stats.Width) / 2
- picwavetime.Left = (ScaleWidth - picwavetime.Width) / 2
- End Sub
- Sub Form_Unload (Cancel As Integer)
- CloseWavePlay
- End Sub
- Sub OpenOption_Click ()
- Dim success As Integer
- PlayOption.Enabled = False
- EchoOption.Enabled = False
- EffectsMenu.Enabled = False
- FileOpenDialog.Action = 1
- wavepath = FileOpenDialog.Filename
- 'check wavefile,if not a format tag of 1 then do not plot
- If Not checkformat((FileOpenDialog.Filename)) Then
- Exit Sub
- End If
- If OpenWaveFile(FileOpenDialog.Filename) Then
- PlayOption.Enabled = True
-
- EchoOption.Enabled = True
- EffectsMenu.Enabled = True
- command1.Enabled = True
- cmd_playwave.Enabled = True
-
- picwavetime.Cls
- picwavetime.Print "00:00.00"
-
- 'plot the wave if a format tag of 1
- EchoOption_Click
-
- End If
- End Sub
- Sub PlayOption_Click ()
- 'play the wave
- Dim dummy As Integer
- dummy = WaveOut()
- End Sub
- Sub QuitOption_Click ()
- Unload waveplot
- End
- End Sub
-